package com.ssm.user.designPattern.abstractFactoryPattern.easy.Shape;

import com.ssm.user.designPattern.abstractFactoryPattern.easy.AbstractFactory;
import com.ssm.user.designPattern.abstractFactoryPattern.easy.Color.Color;

public class ShapeFactory extends AbstractFactory {

    //根据getShape方法获取形状类型的对象
    public Shape getShape(String shapeType) {
        if(shapeType == null) {
            return null;
        }

        if(shapeType.equalsIgnoreCase("CIRCLE")) {
            return new Circle();
        } else if(shapeType.equalsIgnoreCase("RECTANGLE")) {
            return new Rectangle();
        }
        return null;
    }

    @Override
    public Color getColor(String color) {
        return null;
    }

}
